<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><link rel="stylesheet" type="text/css" href="style.css">
<%ArrayList<String> myProfile = (ArrayList)session.getAttribute("details");%>
<div id="header">
<ul>
<div><span style="float:right"><a href="Logout.jsp" ><b>Logout</b></a></div>
<form name="Search" action="Search.do" method="post" onsubmit="return validateForm();">
<th> Search people  : </th><th> <input name="search_user" size=50 type="text" /> </th>
<input type="submit" name="submit" class="classname2" value="Search"></form>
<script>
function validateForm()
{
var x=document.forms["Search"]["search_user"].value;
if (x==null || x=="")
  {
  return false;
  }
}
</script>
</ul>
</div>


<div id="navigation">
<ul>
<img src="<%=myProfile.get(6)%>" width="100" height="100"><br>
<a href="Profile.jsp"  ><b>View My Profile</b></a>
<br><form action="ChatWindow.do" method="post"><input type="submit" class="classname" name="submit" value="Chat Room	     "></form>
<form action="FriendsList.do" method="post">
<th> <input name="submit" size=50 type="submit" class="classname" value="Friends		     "/> </th></form>
<form action="PendingRequests.do" method="post">
<th> <input name="submit" size=40 type="submit" class="classname" value="Friend Requests"/> </th></form>
</ul>
</div>

<div id="content">
<ul>
<%ArrayList<String> buddyProfile = (ArrayList)session.getAttribute("buddyDetails");
String friends = (String)session.getAttribute("friends");
if(!buddyProfile.isEmpty()){%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title><%=buddyProfile.get(0)%> <%=buddyProfile.get(1)%></title>
</head>
<body>
<br>
<br>
<img src="<%=buddyProfile.get(6)%>" width="60" height="60"><br>
<%=buddyProfile.get(0)%> <%=buddyProfile.get(1)%><br>
<%=buddyProfile.get(2)%><br>
<%=buddyProfile.get(3)%><br>
<%=buddyProfile.get(4)%>
<%String emailaddress = buddyProfile.get(4);
session.setAttribute("emailaddress",emailaddress);%>
<%}%>
<%if (session.getAttribute("friends").equals("accept-decline")){  %>
<form action="AcceptDecline.do" method="get">
<input name="submit" size=30 type="submit" class = "classname" value="Accept "/></form>
<form action="AcceptDecline.do" method="post">
<input name="submit" size=30 type="submit" class = "classname" value="Decline"/></form>
<%}else{ 
if (!session.getAttribute("emailaddress").equals(session.getAttribute("loginEmail"))){%>
<form action="FriendsAction.do" method="get">
<th> <input name="submit" size=30 class = "classname" type="submit" value="<%=session.getAttribute("friends")%>"/> </th></form>
<% %>
<%}}%>
</ul>
</div>
</body>
</html>